if(${BACKEND} STREQUAL LINUX)
    file(GLOB_RECURSE SOURCES src/linux/*.cpp)
    file(GLOB_RECURSE HEADERS src/linux/*.h)
    set(LIBRARIES pcap)
elseif(${BACKEND} STREQUAL MACOS)
    file(GLOB_RECURSE SOURCES src/macOS/*.cpp)
    set(LIBRARIES pcap)
elseif(${BACKEND} STREQUAL STDIO)
    file(GLOB_RECURSE SOURCES src/stdio/*.cpp)
    set(LIBRARIES pcap)
elseif(${BACKEND} STREQUAL XILINX)
    file(GLOB_RECURSE SOURCES src/xilinx/*.c)
endif()

add_library(router_hal ${SOURCES} ${HEADERS})
target_include_directories(router_hal PUBLIC include)
target_link_libraries(router_hal ${LIBRARIES})

option(HAL_TESTING "Use testing parameters for HAL" OFF)
if(${HAL_TESTING} STREQUAL ON)
    add_definitions("-DHAL_PLATFORM_TESTING")
endif()